package com.permission.dao;

import com.permission.entity.SysUserRole;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface SysRoleUserMapper {

    int deleteByPrimaryKey(Integer id);

    int insert(SysUserRole record);

    int insertSelective(SysUserRole record);

    SysUserRole selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(SysUserRole record);

    int updateByPrimaryKey(SysUserRole record);

    //根据用户ID查询角色ID列表
    List<Integer> getRoleIdListByUserId(@Param("userId") int userId);

    //根据角色ID查询用户ID列表
    List<Integer> getUserIdListByRoleId(@Param("roleId") int roleId);

    void deleteByRoleId(@Param("roleId") int roleId);

    void batchInsert(@Param("roleUserList") List<SysUserRole> roleUserList);

    //根据角色ID列表查询用户ID列表
    List<Integer> getUserIdListByRoleIdList(@Param("roleIdList") List<Integer> roleIdList);
}